package com.ssm.comm.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class EurekaServiceAddressDTO implements Serializable {

    private int port;
    private String host;

    /**
     * 将服务地址转换为 http://主机名:端口/ 的格式
     * @return
     */
    @Override
    public String toString() {
        return new StringBuilder().append("http://").append(host).append(":").append(port).toString();
    }
}
